From a41b73fbc71f613e4ca90ae8b9dd3bd317d026d6 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Thu, 21 Feb 2013 12:55:50 -0600 Subject: [PATCH] GtkWidget::draw() - Document how to get the dirty region Signed-off-by: Federico Mena Quintero --- gtk/gtkwidget.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a0301e8ba3..6cbe0ffb62 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1805,6 +1805,13 @@ gtk_widget_class_init (GtkWidgetClass *klass) * restore it. The signal emission takes care of calling cairo_save() * before and cairo_restore() after invoking the handler. * + * The signal handler will get a @cr with a clip region already set to the + * widget's dirty region, i.e. to the area that needs repainting. Complicated + * widgets that want to avoid redrawing themselves completely can get the full + * extents of the clip region with gdk_cairo_get_clip_rectangle(), or they can + * get a finer-grained representation of the dirty region with + * cairo_copy_clip_rectangle_list(). + * * Returns: %TRUE to stop other handlers from being invoked for the event. % %FALSE to propagate the event further. * -- 2.30.2